const express = require("express");
const router = express.Router();
const { verifyToken, getUserId } = require("../jsonwebtoken/index");

const { RegisterOrLogin } = require("../API/User/RegisterOrLogin");
const { Login } = require("../API/User/Login");
const { RefreshToken } = require("../API/User/RefreshToken");

const { GetKeyTipsList } = require("../API/Article/GetKeyTipsList");
const { CreateArticle } = require("../API/Article/CreateArticle");
const { GteArticleList } = require("../API/Article/GteArticleList");
const { LikeArticle } = require("../API/Article/LikeArticle");
const { GetMenuTabs } = require("../API/Home/GetMenuTabs");
const { GetPinsTabs } = require("../API/Home/GetPinsTabs");
const { GetActivityList } = require("../API/Article/GetActivityList");
const { GetAuthorList } = require("../API/Article/GetAuthorList");
const { GetAdvertisementList } = require("../API/Article/GetAdvertisementList");
const {
  GetArticleAndAuthorInfoDetails,
} = require("../API/Article/GetArticleAndAuthorInfoDetails");

const { UploadFile } = require("../API/Upload/Upload");
const { EditorUploadFile } = require("../API/Upload/EditorUpload");

const { GetLabelList } = require("../API/Label/GetLabelList");

//评论
const {
  GetArticleCommentList,
} = require("../API/Comment/GetArticleCommentList");
const { PostComment } = require("../API/Comment/PostComment");
const { PostLike } = require("../API/Comment/PostLike");

const { sendCode } = require("../API/Wx/sendMessage");

const { CreateColumns } = require("../API/Columns/CreateColumns");

router.post("/login", Login);
router.post("/refreshToken", RefreshToken);
router.post("/RegisterOrLogin", RegisterOrLogin);

router.post("/GetKeyTipsList", GetKeyTipsList);
router.post("/CreateArticle", verifyToken, CreateArticle);
router.post("/GteArticleList", getUserId, GteArticleList);
router.post("/LikeArticle", verifyToken, LikeArticle);
router.post("/GetActivityList", GetActivityList);
router.post("/GetAuthorList", GetAuthorList);
router.get("/GetAdvertisementList", GetAdvertisementList);
router.post("/GetArticleAndAuthorInfoDetails", GetArticleAndAuthorInfoDetails);

router.post("/GetMenuTabs", GetMenuTabs);
router.post("/GetPinsTabs", GetPinsTabs);

router.post("/UploadFile", UploadFile);
router.post("/EditorUploadFile", EditorUploadFile);

router.post("/GetLabelList", GetLabelList);

//评论
router.post("/GetArticleCommentList", GetArticleCommentList);
router.post("/PostComment", verifyToken, PostComment);
router.post("/PostLike", verifyToken, PostLike);

router.post("/sendCode", sendCode);

//专栏
router.post("/CreateColumns", verifyToken, CreateColumns);

module.exports = router;
